package com.chenfan.mcn.model.vo;

import com.chenfan.mcn.enums.BusinessCommissionEnum;
import com.chenfan.mcn.model.common.PageInfo;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * @Author liuyang
 * @Date 2021/6/11
 * @Time 16:38
 * @Version V1.0
 **/
@Data
public class DepartmentInfo {

    /**
     * 商务提成编号
     */
    private String businessCommissionCode;

    /**
     * 提成单标题
     */
    private String title;

    /**
     * 提成单状态(1-新建，2-已发送，3-已确认，4-已发放, 9-已作废)
     */
    private Integer businessStatus;

    /**
     * 状态名称
     */
    private String businessStatusName;

    /**
     * 姓名
     */
    private String name;

    /**
     * 部门
     */
    private String departmentName;

    /**
     * 角色
     */
    private String roleName;

    /**
     * 销售总额
     */
    private BigDecimal totalSales;

    /**
     * 部门目标达成率
     */
    private BigDecimal targetAchievementRate;

    /**
     * 提成总金额
     */
    private BigDecimal totalAmount;

    /**
     * 提成明细
     */
    private PageInfo<BusinessCommissionDetailVO> businessCommissionDetailVoPageInfo;

    public String getBusinessStatusName() {
        if (Objects.nonNull(getBusinessStatus())) {
            return BusinessCommissionEnum.getStatusName(getBusinessStatus());
        }
        return null;
    }

    /**
     * 是否确认提成单：0否1是
     */
    private Integer isConfirmed;

    /**
     * 季度编号
     */
    private String quarterCode;
}
